import React, { useState } from "react";
import { useCacheContext } from "../../components/keepalive-cpn/KeepAliveProvider";
function Test1(props) {
  const { cacheStates } = useCacheContext();
  const [flag, setFlag] = useState(false);
  const changeFn = () => {
    console.log("adada", cacheStates);
  };
  const clickFn = () => {
    setFlag(!flag);
    console.log("cacheStates", cacheStates);
  };
  return (
    <div>
      <div>{flag ? "hh" : "xx"}</div>
      <input onChange={changeFn}></input>
      <button onClick={clickFn}>开关</button>
    </div>
  );
}
Test1.prototype.isKeepAlive = true;
export default Test1;
